<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<div class="background" id="web_bg"> 
		<img style="position: cover;" Border="0" src="正大广场.jpg" height="100%"
		width="100%" />
	</div>
<style type="text/css"> 
.background{
 position: absolute;  
width: 100%;  
 height: 100%; 
  z-index: -1; 
 } 
</style>

<base
	href="<%=request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
					+ request.getContextPath() + "/"%>" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生注册页面</title>
<!--<script type="text/javascript" src=""></script><link href="" type="text/css" rel="stylesheet" />-->
</head>
<script language="javascript" type="text/javascript"> //javascript代码用来校检表单信息是否为空

	function userCheck(studentnumber,password,realname,phone,email) {
		if (document.form1.studentnumber.value == "") {
			window.alert("请输入学号！");
			return false;
		}
		if (!(document.form1.studentnumber.value.length == 10)) {
			window.alert("学号必须是10位数字");
			return false;
		}
		if (document.form1.password.value == "") {
			window.alert("请输入用户密码！");
			return false;
		}
		if (document.form1.againpassword.value == "") {
			window.alert("请确认用户密码！");
			return false;
		}
		if (document.form1.againpassword.value != document.form1.password.value) {
			window.alert("您输入的两次密码不相同，请重新输入用户密码！");
			return false;
		} else if (document.form1.againpassword.value.length<5 || document.form1.againpassword.value.length>10) {
			window.alert("密码必须在5—10位之间");
			return false;
		} 
// 		 if (!Pattern.matches("\\w+@\\w+\\.\\w+", email)) {
// 		    	JOptionPane.showMessageDialog(this, "请输入合法的电子邮箱！", "警告信息", JOptionPane.WARNING_MESSAGE);
// 		    	return;
// 		    	}
// 		    	// 校验用户名是否存在
// 		    	if (DBUtil.exists(studentnumber)) {
// 		    	JOptionPane.showMessageDialog(this, "用户名已经存在", "警告信息", JOptionPane.WARNING_MESSAGE);
// 		    	return;
// 		    	}
		else 
			if (!(document.form1.phone.value.length == 11)) {
			window.alert("电话号码格式不正确");
			return false;
		} 
// 			 var isemail= /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/); 
// 			 if(isemail.test(document.form1.email.value)){
// 				 window.alert("邮箱格式不正确，请输入正确的邮箱！");
// 					return false;
// 			 }	else
// 				 return isemail.test(email);	
// 			rst = ps.executeQuery();
// 			if (rst.next() == true) {
// 				window.alert("该学号的用户已存在!");
// 				return false;
// 			}
			return true;
		}
</script>

<body>
	<Font size=5
		style="position: absolute; top: 40%; left: 40%; margin: -50px 0 0 -100px;">
		<center>
			<font size="6"><b>欢迎进入注册界面</b></font><br> <br> <font
				size="5"><b> 基本信息注册</b></font> <br></br>
			<form action="RegisterServlet" Method="post" name="form1"
				onsubmit="return userCheck()">
				<input type="hidden" name="action" value="add" />
				<table>
					<tr>
						<td>学号：</td>
						<td><input class="txtInput" type="text" name="studentnumber"
							maxlength='10' ><font color="red">*</font><font
							color="black" size="2">请输入10位学号</font></td>
					</tr>
					<tr>
						<td>设置密码：</td>
						<td><input class="txtInput" type=password name="password"
							value="222222"><font color="red">*</font><font
							color="black" size="2">请输入5-10位密码</font></td>
					</tr>
					<tr>
						<td>重新输入密码：</td>
						<td><input class="txtInput" type=password
							name="againpassword" value="222222"><font color="red">*</font><font
							color="black" size="2">请输入5-10位密码</font></td>
					</tr>
					<tr>
						<td>真实姓名：</td>
						<td><input class="txtInput" type="text" name="realname"
							value="啦啦啦"><font color="red">*</font></td>
					</tr>
					<tr>
						<td>联系电话：</td>
						<td><input class="txtInput" type="text" name="phone"
							maxlength='11' value="55555555555"></td>
					</tr>
					<tr>
						<td>电子邮箱</td>
						<td><input class="txtInput" type="text" name="email"></td>
					</tr>
					<tr>
						<td align="center"><input type="submit" name="Submit"
							value="注册" /></td>
					</tr>
					<tr>
						<td>注意：<font color="red">*</font>为必填内容！
						</td>
					</tr>
				</table>
			</form>
		</center>
	</Font>
</body>
</html>